package cn.yuanqiao.web.controller.cqbc;
/**
 * @author 赵常飞
 * @date 2024/6/21 14:17
 */

import cn.yuanqiao.common.core.domain.R;
import cn.yuanqiao.common.core.controller.BaseController;
import cn.yuanqiao.common.core.domain.AjaxResult;
import cn.yuanqiao.common.core.page.TableDataInfo;
import cn.yuanqiao.common.annotation.Log;
import cn.yuanqiao.common.enums.BusinessType;
import cn.yuanqiao.cqbc.deleteIdentify.service.IDeleteIdentifyService;
import com.alibaba.fastjson2.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 *@Author: 赵常飞
 *@Date: 2024/6/21 14:17
 *@Description:
 *@Note:
 */
@RestController
@RequestMapping("/cqbc/deleteIdentify")
public class DeleteIdentifyController extends BaseController {
    @Autowired
    private IDeleteIdentifyService deleteIdentifyService;

    @Log(title = "获取分类存储树", businessType = BusinessType.SELECT)
    @GetMapping("/gettrees")
    public AjaxResult gettrees(){
        return success(deleteIdentifyService.getTreeList());
    }

    @PostMapping("/getList")
    @Log(title = "获取列表数据", businessType = BusinessType.SELECT)
    public TableDataInfo getList(@RequestBody JSONObject json)
    {
        startPage();
        List<Map<String,Object>> list = deleteIdentifyService.getList(json);
        return getDataTable(list);
    }

    @PostMapping("/fqsp")
    @Log(title = "发起审批", businessType = BusinessType.SUBMIT)
    public AjaxResult fqsp(@RequestBody JSONObject json)
    {
        int i = deleteIdentifyService.fqsp(json);
        return success(i);
    }
    @Log(title = "长期保存删除鉴定办结", businessType = BusinessType.UPDATE)
    @PostMapping("/cqbcDeleteBanjie")
    public R<Integer> cqbcDeleteBanjie(@RequestBody Map<String,Object> map) {
        int i = deleteIdentifyService.cqbcDeleteBanjie(map);
        return R.ok(Integer.valueOf(i));
    }

    @Log(title = "长期保存删除鉴定审批流程不同意", businessType = BusinessType.UPDATE)
    @PostMapping("/killcqbcDelete")
    public AjaxResult killcqbcDelete(@RequestBody Map<String,Object> map) {
        deleteIdentifyService.killcqbcDelete(map);
        return AjaxResult.success();
    }

}
